package com.example.school.service;

import com.example.school.entity.Course;
import com.example.school.mapper.CourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseService {

    @Autowired
    private final  CourseMapper courseMapper;

    @Autowired
    public  CourseService(CourseMapper courseMapper) {
        this.courseMapper = courseMapper;
    }

    public List<Course> findCoursesByTeacherName(String name) {
        return courseMapper.findCoursesByTeacherName(name);
    }

    public List<Course> findCoursesByCollege(String college) {
        return courseMapper.findCoursesByCollege(college);
    }


}
